package com.example.day05.exercise;

class Pet{
    public void run(){
       System.out.println("pet is running");
    }
}

class Dog extends Pet{
    public void run(){
       System.out.println("dog is running");
    }
}
//测试类
class Test1{
    public static void main(String[] args){
        Pet p1 =  new Dog();
        System.out.println(p1 instanceof Dog);
        System.out.println(p1 instanceof Pet);
        p1.run();
        
        Dog d1 = (Dog)p1;
        System.out.println(d1 instanceof Dog);
        System.out.println(d1 instanceof Pet);
        d1.run();
        
        Pet p2 =  new Pet();
        Dog d2 = (Dog)p2;
        System.out.println(d2 instanceof Dog);
        System.out.println(d2 instanceof Pet);
    }
    public void fun1(int x,int y){}

    public void fun1(int x,long y){}
    
}